//
//  BXDemoViewController.swift
//  weibo
//
//  Created by EDZ on 2017/8/10.
//  Copyright © 2017年 EDZ. All rights reserved.
//

import UIKit

class BXDemoViewController: BXBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }

    
   /// mark - 监听方法
   // 继续 PUSH 一个新的控制器
   @objc fileprivate func showNext()  {
        let vc = BXDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
        
    }
   
}

extension BXDemoViewController{
    
    // 重写父类方法
    override func setupUI() {
        super.setupUI()
        
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        let btn:UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
    
}
